<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
	<head>
		<title>团队统计</title>
		<%@include file="/WEB-INF/base.jspf"%>
<style>
.body_wrapper {
	height: 100%;
	width: 100%;
	box-sizing: border-box;
	padding: 0px 20px;
}

.wrapper_buttons {
	position: relative;
}
	.modal-dialog {
		max-width: 1000px;
	}
.shezhileiContent {
	width: 160px;
	height: 150px;
	border: 1px solid #9c8f8f;
	border-radius: 5px;
	box-sizing: border-box;
	padding: 13px;
	position: absolute;
	right: 0px;
	top: 36px;
	z-index: 999;
	background: #fff;
}

.shezhileiContent li {
	margin-bottom: 10px;
}

.shezhileiContent li span {
	margin-left: 6px;
}

.wrapper_buttons input {
	height: 32px;
	width: 174px;
	margin-left: 10px;
}

.wrapper_buttons button {
	margin-left: 10px;
}

#table_id_example01_paginate, #table_id_example02_paginate,
	#table_id_example03_paginate, #table_id_example04_paginate {
	margin-right: 100px;
	text-align: center;
}

.modal {
	overflow: auto!important;
}
.td-hidden {
	display: none;
}

.p-c-flexwrapper {
	    width: 49%;
		display:inline;
		align-items:center;
		margin-right:16px;
		margin-bottom:32px;
		
	}
	.p-c-flexwrapper > span {
		width:80px;
	}
		.modal-dialog {
		max-width: 1000px;
	}
	.p-c-flexwrapper > .form-control {
		width:180px;
	}
	.input-auto {
		width:auto;
		display: inline;
		margin-bottom: 20px;
	}
	table th,table tr,table td {
	text-align: center;
	vertical-align:middle;
	}
	
	#onelinezj td,#twolinezj td,#threelinezj td,#fourlinezj td,#fivelinezj td{
		cursor:pointer;
	}
	
	#onelinezj td:hover,#twolinezj td:hover,#threelinezj td:hover,#fourlinezj td:hover,#fivelinezj td:hover{
		background: #ddd;
	}
	
	.cib {
            padding: 5px 2px;
        }

        .cib input {
            vertical-align: bottom;
            height: 20px;
            color: #567e84;
            margin: 2px 0px;
        }

        .cib button {
            vertical-align: bottom;
            height: 26px;
            cursor: pointer;
            background-color: #cbefff;
            border: 1px solid #44a8d6;
            color: #567e84;
            margin: 2px 0px;
        }

        .desc {
            padding-left: 2px;
            color: #657e9a;
        }

        .code-con{
            font-size: 18px;
        }

        .hr-c{
            background-color: #2196F3;
            height: 5px;
            border: 0px;
        }
</style>
	</head>
	<body>
		<div class="wrapper_buttons" style="display: flex; margin-top: 20px;">
			<input type="text" name="" id="obj-date1" placeholder="开始时间" />
			 <input type="text" name="" id="obj-huiyhuanzh" value="" class="form-control" placeholder="单用户查询" />
			<button type="button" class="layui-btn layui-btn-radius" id="btn-searche-find">查询</button>
			<button type="button" class="layui-btn layui-btn-radius" id="btn-reset-close">重置</button>
			<br/>
		</div>
		 <div class="wrapper_buttons"
			style="display: flex; margin-bottom: 20px;">
			<input type="text" name="" id="obj-date2" placeholder="结束时间" /> 
		</div> 
		<div style="margin-bottom: 26px;">		
		<table id="table_id_example01" class="table-normal-datatables table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>在线充值</th>
					<th>人工加款</th>
					<th>在线提款</th>
					<th>人工扣款</th>
					<th>提款失败</th>
					<th>代理返点</th>
				</tr>
			</thead>
			<tbody>
					<tr id="onelinezj">
						<td class="obj-zxchongzhi" data-type="0"></td>
						<td class="obj-rgjiakuan" data-type="0"></td>
						<td class="obj-zxtikuan" data-type="1"></td>
						<td class="obj-rgkoukuan" data-type="1"></td>
						<td class="obj-tkshibai" data-type="2"></td>
						<td class="obj-dlfandian" data-type="2"></td>
					</tr>
				</tbody>
			
		</table>
		<table id="table_id_example02" class="table-normal-datatables table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>彩票投注</th>
					<th>系统彩投注</th>
					<th>彩票撤单</th>
					<th>系统彩撤单</th>
					<th>彩票派奖</th>
					<th>系统彩派奖</th>
				</tr>
			</thead>
		<tbody>
					<tr id="twolinezj">
						<td class="obj-cptouzhu" data-type="3"></td>
						<td class="obj-xtctouzhu" data-type="3"></td>
						<td class="obj-cpchedan" data-type="2"></td>
						<td class="obj-xtcchedan" data-type="2"></td>
						<td class="obj-cppaijiang" data-type="3"></td>
						<td class="obj-xitcpaijiang" data-type="3"></td>
					</tr>
				</tbody>
		</table>
		<table id="table_id_example03" class="table-normal-datatables table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>港彩特码B返水</th>
					<th>彩票开奖异常</th>
					<th>系统彩开奖异常</th>
					<th>百家乐投注</th>
					<th>百家乐派奖</th>
					<th>每日签到</th>
				</tr>
			</thead>
				<tbody>
					<tr id="threelinezj">
						<td class="obj-tmbfanshui" data-type="2"></td>
						<td class="obj-cpyichang" data-type="2"></td>
						<td class="obj-xtcyichang" data-type="2"></td>
						<td class="obj-bjltouzhu" data-type="2"></td>
						<td class="obj-bjlpaijiang" data-type="2"></td>
						<td class="obj-mrqiandao" data-type="2"></td>
					</tr>
				</tbody>
		</table>
		<table id="table_id_example04" class="table-normal-datatables table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>幸运转盘</th>
					<th>每日返水</th>
					<th>每月返水</th>
					<th>注册赠送</th>
					<th>充值赠送</th>
					<th>活动赠送</th>
				</tr>
			</thead>
			<tbody>
					<tr id="fourlinezj">
						<td class="obj-xyzhuanpan" data-type="2"></td>
						<td class="obj-mrfanshui" data-type="2"></td>
						<td class="obj-myfanshui" data-type="2"></td>
						<td class="obj-zczengsong" data-type="2"></td>
						<td class="obj-czzengsong" data-type="2"></td>
						<td class="obj-hdzengsong" data-type="2"></td>
					</tr>
				</tbody>
		</table>
		<table id="table_id_example05" class="table-normal-datatables table table-striped table-bordered table-hover">
			<thead>
				<tr>
					<th>彩票输赢</th>
					<th>系统彩输赢</th>
					<th>百家乐输赢</th>
					<th>全部输赢</th>
					<th>团队余额</th>
					<th>投注人数</th>
				</tr>
			</thead>
				<tbody>
					<tr id="fivelinezj">
						<td class="obj-caipiaosy" data-type="4"></td>
						<td class="obj-xitongcaisy" data-type="4"></td>
						<td class="obj-bjlshuying" data-type="2"></td>
						<td class="obj-quanbusy" data-type="4"></td>
						<td class="obj-tuanduiyue" data-type="4"></td>
						<td class="obj-orderCount" data-type="4"></td>
					</tr>
				</tbody>
		</table>
		</div>
		<p style="color: red;">备注：输赢是针对平台计算的，负数代表平台在亏钱;</p>
		<p style="margin-left: 42px; color: red;">彩票输赢 ＝ 彩票投注 － 彩票撤单 －开奖异常 －  彩票派奖;</p>
		<p style="margin-left: 42px; color: red;">系统彩输赢 ＝ 系统彩投注 － 系统彩撤单  －开奖异常 － 系统彩派奖;</p>
		<p style="margin-left: 42px; color: red;">百家乐输赢 ＝ 百家乐投注 － 百家乐派奖;</p>
		<p style="margin-left: 42px; color: red;">全部输赢 ＝ 有效投注 － 有效派奖－代理返点－日常反水－玩法反水－日常签到－幸运转盘－平台赠送－活动赠送 ;</p>
		<p style="margin-left: 42px; color: blue;">统计比较消耗系统性能，统计结果将缓存1分钟;</p>
	</body>
	<script>
	layui.use('laydate', function() {
		var laydate = layui.laydate;
		laydate.render({
			elem : '#obj-date1', 
		    value: new Date(),
		    max: new Date()+1
		});
		laydate.render({
			elem : '#obj-date2',
			value: new Date(),
		    max: new Date()+1
		});
	});
	
	var datas;
	$(function(){
		datas = {startTime:$('#obj-date1').val(),endTime:$('#obj-date2').val(),userName:""};		
		findReport(datas); //进入页面查询
		$('#btn-searche-find').on('click',searcheAllGlobalReport); //查询重置
		$('#btn-reset-close').on('click',resetReport); //查询重置
	});
	
	function findReport(datas){
		$.ajax({
            dataType: "json",
            type: "post",
            url: "/userAgent/teamInfo.do",
            data: datas,
            success: function (data) {
            	var result = Object.keys(data.data)
            	for(var i=0;i<result.length;i++){
            		var a = result[i];
            		var b = data.data[a];
            		if($('.obj-'+a).length>0){
            			$('.obj-'+a).html(b)
            		}
            	}
            }
        });
	}
	
	function searcheAllGlobalReport(event){
		datas = {
			startTime:$('#obj-date1').val(),
			endTime:$('#obj-date2').val(),
			userName:$('#obj-huiyhuanzh').val()		
		};
		findReport(datas);
	}
	
	function resetReport(){
		$('#obj-date1').val('');
		$('#obj-date2').val('');
		$('#obj-huiyhuanzh').val('');
		datas = {
				startTime:$('#obj-date1').val(),
				endTime:$('#obj-date2').val(),
				userName:$('#obj-huiyhuanzh').val()		
		};
		findReport(datas);
	}
	</script>
</html>
